﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Critr
{
    class logdbQueryBuilder
    {
        private StringBuilder sb;

        public logdbQueryBuilder()
        {
            sb = new StringBuilder("SELECT TOP 100 LogHeader.ShowName, LogEntry.Title, LogEntry.Artist, LogEntry.Album, LogEntry.Duration, LogEntry.Log, LogEntry.Cancon, LogEntry.Hit, LogEntry.Chart, LogEntry.Class FROM LogEntry INNER JOIN LogHeader ON LogEntry.LogHeader_id = LogHeader.id WHERE 1=1");
        }

        public override string ToString()
        {
            return sb.ToString();
        }

        public void Condition(string column, string value)
        {
            sb.Append(" AND " + column + " = '" + value + "'");
        }
    }
}
